package com.keba.lamp.base.manager.user;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.keba.basic.base.manager.SuperCacheManager;
import com.keba.basic.interfaces.echo.LoadService;
import com.keba.lamp.base.entity.user.BaseEmployee;
import com.keba.lamp.base.vo.query.user.BaseEmployeePageQuery;
import com.keba.lamp.base.vo.result.user.BaseEmployeeResultVO;
import com.keba.lamp.system.vo.result.tenant.DefUserTenantRelResultVO;

import java.util.List;

/**
 * <p>
 * 通用业务接口
 * 员工
 * </p>
 *
 * @author zuihou
 * @date 2021-10-18
 */
public interface BaseEmployeeManager extends SuperCacheManager<BaseEmployee>, LoadService {
    /**
     * 根据用户id查询员工
     *
     * @param userId 用户id
     * @return
     */
    List<DefUserTenantRelResultVO> listEmployeeByUserId(Long userId);

    List<DefUserTenantRelResultVO> listEmployeeByUserIdAndTenantId(Long userId, Long tenantId);

    /**
     * 分页查询
     *
     * @param page    分页对象
     * @param wrapper 查询条件
     * @param model   参数
     * @return 分页用户数据
     */
    IPage<BaseEmployeeResultVO> selectPageResultVO(IPage<BaseEmployee> page, Wrapper<BaseEmployee> wrapper, BaseEmployeePageQuery model);

    /**
     * 查询员工信息
     *
     * @param tenantId tenantId
     * @param userId   userId
     * @return com.keba.lamp.base.entity.user.BaseEmployee
     * @author tangyh
     * @date 2022/2/12 4:36 PM
     * @create [2022/2/12 4:36 PM ] [tangyh] [初始创建]
     */
    BaseEmployee getEmployeeByTenantAndUser(Long tenantId, Long userId);

    /**
     * 查询总记录数
     *
     * @param queryWrapper wrapper
     * @return 数量
     */
    long countIgnore(Wrapper<BaseEmployee> queryWrapper);

    /**
     * 根据 UpdateWrapper 条件，更新记录 需要设置sqlset
     *
     * @param wrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper}
     * @return boolean
     */
    boolean updateIgnore(Wrapper<BaseEmployee> wrapper);

    /**
     * 查询
     *
     * @param wrapper wrapper
     * @return java.util.List<com.keba.lamp.base.entity.user.BaseEmployee>
     * @author tangyh
     * @date 2022/2/12 6:19 PM
     * @create [2022/2/12 6:19 PM ] [tangyh] [初始创建]
     */
    List<BaseEmployee> listIgnore(Wrapper<BaseEmployee> wrapper);
}
